using STHPMS1.ICore.I_Core;
using STHPMS1.ICore.I_DAL;

namespace STHPMS1.Common.C_Extension
{
	public static class CoreExt
	{
		public static T ScenceDecorator<T> (T obj, IScene scene) where T : ISceneGet
		{
			if (scene != null)
				obj.Scene = scene;
			return obj;
		}

		public static T DalFactoryDecorator<T> (T obj, IDalFactory factory) where T : ISourceDal
		{
			if (factory != null)
				obj.Factory = factory;
			return obj;
		}

		public static T RepositoryDecorator<T> (T obj, IRepository repository) where T : IRepositoryGet
		{
			if (repository != null)
				obj.Adapter = repository;
			return obj;
		}
	}
}
